Copyright: ®1995 Synchro-Graphix Software
Citation: Created By H. Orloff


Context
 Magic Panel version 1.2

©Copyright 1995 Synchro-Graphix Software All Rights Reserved

Installing Magic Panel into Delphi

Magic Panel Properties, Events, and Methods

What's new in version 1.2

Using Magic Panel example

Copyright/License notice

Registration


Installing
Installing Magic Panel

To install Magic Panel into Borlands Delphi.

1.	Create a directory on your hard drive.  eg:  C:\CustCntl

2.	Copy the contents of the disk to the new hard drive directory

3.	Start Borlands Delphi

4.	Click on the Options|Install Components... menu

5.	Click the Add... button from the Install Components Dialog

6.	Click the Browse... button from the Add Module Dialog

7.	Select the directory (you created above) and file name MAGICPNL.DCU which you 	copied into the directory from the floppy disk, and click the OK button.

8.	The Magic Panel will be compiled into Delphi and will be displayed on the 	'Additional' tab.

Note:  If your running in 640x480 the Magic Panel speed button will not be visible until you scroll to the right to view it.


TMagicPanel
TMagicPanel Component

Properties	Methods	Events

Description

The TMagicPanel component is used to place MagicPanels on a form on which other controls can be placed.

MagicPanels have the ability to label child controls based on the child controls Hint property.

MagicPanels can be aligned with the form so that they maintain the same relative position to the form even  when the form is resized.

To customize the appearance of a MagicPanel, use MagicPanel's BevelInner, BevelOuter, BevelWidth, and BorderWidth properties.

Seven additional properties have been defined for MagicPanel, including all properties and methods of the TPanel control, and in addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


Properties

 Run Time Only	 Key Properties

 About	 Cursor	 Name

 Align	 DragCursor	 Owner

 Alignment	 DragMode	 Parent

 BevelInner	 Enabled	 ParentColor

 BevelOuter	 Font	 ParentCtl3D

 BevelWidth	 Height	 ParentFont

 BorderStyle	 HelpContext	 ParentShowHint

 BorderWidth	 Hint	 PopupMenu

 BoundsRect	 HintAsLabel	 ShowHint

 Caption	 HintInterSpace	 Showing

 Color	 HintLabelFont3D	 TabOrder

 ComponentCount	 HintLabelHPosition	 TabStop

 ComponentIndex	 HintLabelPosition	 Tag

 Components	 HintLabelVPosition	 Top

 ControlCount	 HintLabelWidth	 Visible

 Contorls	 Left	 Width

 Ctl3D	 Locked


Methods

 Run Time Only	 Key Properties

 BeginDrag	 GetTextBuf	 ScaleBy

 BringToFront	 GetTextLen	 ScreenToClient

 CanFocus	 Hide	 ScrollBy

 ClientToScreen	 InsertComponent	 SendToBack

 ContainsControl	 InsertControl	 SetBounds

 Dragging	 Invalidate	 SetFocus

 EndDrag	 Refresh	 SetTextBuf

 FindComponent	 RemoveComponent [image] Show

 Focused	 Repaint	 Update


Events

 Run Time Only	 Key Properties

 OnClick	 OnDragOver	 OnMouseMove

 OnDblClick	 OnEndDrag	 OnMouseUp

 OnDragDrop	 OnMouseDown	 OnResize


About
About Property

Description

The About property will display a message box containing copyright information.


Align
Align Property

Description

The Align property determines how the controls align within their container (or parent control). These are the possible values:

Value	Meaning

alNone	The component remains where you place it in the form. This is the default value.

alTop	The component moves to the top of the form and resizes to fill the width of the form. The height of the component is not affected.

alBottom	The component moves to the bottom of the form and resizes to fill the width of the form. The height of the component is not affected.

alLeft	The component moves to the left side of the form and resizes to fill the height of the form. The width of the component is not affected.

alRight	The component moves to the right side of the form and resizes to fill the height of the form. The width of the component is not affected.

alClient	The component resizes to fill the client area of a form. If a component already occupies part of the client area, the component resizes to fit within the remaining client area.

If the form or a component containing other components is resized, the components realign within the form or control.

Using the Align property is useful when you want a control to stay in one position on the form, even if the size of the form changes. For example, you could use a Magic Panel component with a various controls on it as a tool palette. By changing Align to alLeft, you guarantee that the tool palette always remains on the left side of the form and always equals the client height of the form.


Alignment
Alignment Property

Description

The Alignment property specifies how text is aligned within the component.  These are the possible values:

Value	Meaning

taLeftJustify	Align text to the left side of the control

taCenter	Center text horizontally in the control

taRightJustify	Align text to the right side of the control


BevelInner
BevelInner Property

Description

A Magic Panel component has two bevels, an outer bevel drawn next to the border of the control, and an inner bevel drawn inside the outer bevel the number of pixels specified in the BorderWidth property.

The BevelInner property determines the style of the inner bevel of a Magic Panel component. These are the possible values:

Value	Meaning

bvNone	No inner bevel exists.

bvLowered	The inner bevel is lowered.

bvRaised	The inner bevel is raised.


BevelOuter
BevelOuter Property

Description

A Magic Panel component has two bevels, an outer bevel drawn next to the border of the control, and an inner bevel drawn inside the outer bevel. The width of the inner bevel is specified in the BorderWidth property in pixels.

The BevelOuter property determines the style of the outer bevel of a Magic Panel component. These are the possible values:

Value	Meaning

bvNone	No outer bevel exists.

bvLowered	The outer bevel is lowered.

bvRaised	The outer bevel is raised.


BevelWidth
BevelWidth Property

Description

The BevelWidth property determines the width in pixels between the inner and the outer bevels of a Magic Panel. The BevelInner property determines how the inner bevel appears, and the BevelOuter property determines how the outer bevel appears. By changing these properties, you change the appearance of the Magic Panel.


BorderStyle
BorderStyle Property

Description

The BorderStyle property of edit boxes, list boxes, memo controls, grid controls, outlines, and scroll boxes determines whether these components have a border. These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border

If you set the AutoSize property of an edit box to True, the edit box resizes automatically when the font size of the text changes. You must set the value of the BorderStyle property to fsSingle, or else AutoSize has no effect.


BoundsRect
BoundsRect Property

See also Delphi Example of BoundsRect Property

Description

The BoundsRect property returns the bounding rectangle of the control, expressed in the coordinate system of the parent control. The statement

R := Control.BoundsRect;

corresponds to

R.Left := Control.Left;

R.Top := Control.Top;

R.Right := Control.Left + Control.Width;

R.Bottom := Control.Top + Control.Height;


Caption
Caption Property

Description

The Caption property is the text that appears in the form's title bar; this text also appears as the icon label when the form is minimized.


Color
Color Property

Description

For all components or objects except the Color dialog box, the Color property determines the background color of a form or the color of a control or graphics object.

If a control's ParentColor property is True, then changing the Color property of the control's parent automatically changes the Color property of the control. When you assign a value to a control's Color property, the control's ParentColor property is automatically set to False. These are the possible values of Color:

Value	Meaning

clBlack	Black

clMaroon	Maroon

clGreen	Green

clOlive	Olive green

clNavy	Navy blue

clPurple	Purple

clTeal	Teal

clGray	Gray

clSilver	Silver

clRed	Red

clLime	Lime green

clBlue	Blue

clFuchsia	Fuchsia

clAqua	Aqua

clWhite	White

clBackground	Current color of your Windows background

clActiveCaption	Current color of the title bar of the active window

clInactiveCaption	Current color of the title bar of inactive windows

clMenu	Current background color of menus

clWindow	Current background color of windows

clWindowFrame	Current color of window frames

clMenuText	Current color of text on menus

clWindowText	Current color of text in windows

clCaptionText	Current color of the text on the title bar of the active window

clActiveBorder	Current border color of the active window

clInactiveBorder	Current border color of inactive windows

clAppWorkSpace	Current color of the application workspace

clHighlight	Current background color of selected text

clHightlightText	Current color of selected text

clBtnFace	Current color of a button face

clBtnShadow	Current color of a shadow cast by a button

clGrayText	Current color of text that is dimmed

clBtnText	Current color of text on a button

clInactiveCaptionText	Current color of the text on the title bar of an inactive window

clBtnHighlight	Current color of the highlighting on a button

The second half of the colors listed here are Windows system colors. The color that appears depends on the color scheme users are using for Windows. Users can change these colors using the Control Magic Panel in Program Manager. The actual color that appears will vary from system to system. For example, the color fuchsia may appear more blue on one system than another.

When you use the Color dialog box to select a color, you are assigning a new color value to the dialog box's Color property. You can then use the value within the Color property and assign it to the Color property of another control.


ComponentCount
ComponentCount Property

Description

Run-time and read only. The ComponentCount property indicates the number of components owned by the component as listed in the Components array property. For example, ComponentCount of a form contains the same number of items as in the Components list of a form.

Note:	ComponentCount is always 1 more than the highest Components index, because the first Components index is always 0.


ComponentIndex
ComponentIndex Property

Description

Run-time and read only. The ComponentIndex property indicates the position of the component in its owner's Components property list. The first component in the list has a ComponentIndex value of 0, the second has a value of 1, and so on.


Components
Components Property

Description

Run-time and read only. The Components array property is a list of all components owned by the component. You can use the Components property to access any of these owned components, such as the controls owned by a form. The Components property is most useful if you need to refer to owned components by number rather than name.

Don't confuse the Components property with the Controls property. The Components property lists all components that are owned by the component, whereas the Controls property lists all the controls that are child windows of this control. All components on a form are owned by the form, and therefore, they appear in the form's Components property list.

Consider this example. If you put a control in a group box, the form still owns the control, but the control's window parent is the group box control, and therefore, is listed in the group box's Controls property array.


ControlCount
ControlCount Property

Description

Run-time and read only. The ControlCount property indicates the number of controls that are children of the control. The children are listed in the Controls property array.

Note:	The value of ControlCount is always 1 greater than the highest Controls index, because the first

Controls index is 0.


Controls
Controls Property

Description

Run-time and read only. The Controls property is an array of all controls that are children of the control. The Controls property is most useful if you have a need to refer to the children of a control by number rather than name.

Don't confuse the Controls property with the Components property. The Components property lists all  components that are owned by the component, while the Controls property lists all the controls that are

child windows of the control. All components put on a form are owned by the form, and therefore, they appear in the form's Components property list.

For example, if you put a control in a group box, the form still owns the control, but the control's window parent is the group box control, and therefore, is listed in the group box's Controls property array.


Ctl3D
Ctl3D Property

Description

The Ctl3D property determines whether a control has a three-dimensional (3-D) or two-dimensional look. If Ctl3D is True, the control has a 3-D appearance. If Ctl3D is False, the control appears normal or flat. The default value of Ctl3D is True.

For dialog boxes, the value of Ctl3D affects the dialog box and all the controls it contains.  If a control's ParentCtl3D property is True, then changing in the Ctl3D property of the control's parent automatically changes the Ctl3D property of the control. When you assign a value directly to a control's Ctl3D property, the control's ParentCtl3D property is automatically set to False.

Note:	For Ctl3D to work with radio buttons, check boxes, and any of the common dialog boxes, the

CTL3DV2.DLL dynamic-link library must be present on the path.


Cursor
Cursor Property

Description

The Cursor property is the image used when the mouse passes into the region covered by the control.

These are the possible images:

Values

crDefault

crArrow

crCross

crIBeam

crSize

crSizeNESW

crSizeNS

crSizeNWSE

crSizeWE

crUpArrow

crHourglass

crDrag

crNoDrop

crHSplit

crVSplit

To learn how to make a custom cursor available to your application, see the Cursors property in Borland Delphi's Help.


DragCursor
DragCursor Property

Description

The DragCursor property determines the shape of the mouse pointer when the pointer is over a component that will accept an object being dragged. These are the possible images:

Value

crDefault

crArrow

crCross

crIBeam

crSize

crSizeNESW

crSizeNS

crSizeNWSE

crSizeWE

crUpArrow

crHourglass

crDrag

crNoDrop

crHSplit

crVSplit


DragMode
DragMode Property

Description

The DragMode property determines the drag and drop behavior of a control. These are the possible values:

Value	Meaning

dmAutomatic	If dmAutomatic is selected, the control is ready to be dragged; the user just clicks and drags it.

dmManual	If dmManual is selected, the control can't be dragged until the application calls the BeginDrag method.

If a control's DragMode property value is dmAutomatic, the application can disable the drag and drop

capability at run time by changing the DragMode property value to dmManual.


Enabled
Enabled Property

Description

The Enabled property controls whether the control responds to mouse, keyboard, and timer events. If Enabled is True, the control responds normally. If Enabled is False, the control ignores mouse and keyboard events, and in the case of a timer control, the OnTimer event. Disabled controls appear dimmed.


Font
Font Property

Description

The Font property is a font object that controls the attributes of text written on or in the component or object or sent to the printer. To modify a font, you change the value of the Color, Name, Size, or Style properties of the font object.

Font Property of a Font Dialog Box


Height
Height Property

Description

The Height property of a control is the vertical size of the control, form, or graphic in pixels.


HelpContext
HelpContext Property

Description

The HelpContext property provides a context number for use in calling context-sensitive online Help. Each screen in the Help system should have a unique context number. When a component is selected in the application, pressing F1 displays a Help screen. Which Help screen appears depends on the value of the HelpContext property.


Hint
Hint Property

Description

The Hint property is the text string that can appear when the OnHint event occurs, which happens when the user moves the mouse pointer over a control or menu item. The code within the OnHint event handler determines how the string is displayed. A common use of an OnHint event handler is to display the hint as the caption of a Magic Panel component that is being used as a status bar.  You can have a Help Hint, a box containing help text, appear for a control when the user moves the mouse pointer over the control and pauses momentarily.

This is how:

1	Specify a Hint value for each control you want a Help Hint to appear for.

2	Set the ShowHint property of each control to True.

3	At run time, set the value of application's ShowHint property to True.

You can specify a hint to be used for both for a Help Hint box and in an OnHint handler (as the

application's Hint property value) by specifying two values separated by a | character (the "or" or "pipe"

symbol).

For example:

Edit1.Hint := 'Name|Enter Name in the edit box';

The 'Name' string appears in the Help Hint box, and the 'Enter full name' string appears as specified in the OnHint event handler.

If you specify just one value, it can be used both as a Help Hint and as the Hint property of the application. If the application's ShowHint property is False, the Help Hint won't appear, but the other hint still will.

If a control has no Hint value specified, but its parent control does, the control uses the Hint value of the parent control as long as the control's ShowHint property is True.


Left
Left Property

Description

The Left property determines the horizontal coordinate of the left edge of a component relative to the form in pixels. For forms, the value of the Left property is relative to the screen in pixels.

The default value is -1.


Locked
Locked Property

Description

The Locked property determines whether a Magic Panel is replaced by an in-place active OLE object. If Locked is False, the OLE server can replace the Magic Panel. If Locked is True and Magic Panel is aligned to one of the edges of the form (its Align property is alTop, alBottom, alLeft, or alRight), then the Magic Panel remains when an OLE object in a TOLEContainer component is activated in place.

Use Locked to prevent status bars and the like from being replaced.


Name
Name Property

Description

The Name property contains the name of the component as referenced by other components. By default,  Delphi assigns sequential names based on the type of the component, such as 'Button1', 'Button2', and so on. You may change these to suit your needs.

Note:	Change component names only at design time.


Owner
Owner Property

Description

Run-time and read only. The Owner property indicates which component owns the component.  The form owns all components that are on it. In turn, the form is owned by the application.  When one component is owned by another, the memory for the owned component is freed when its owner's memory is freed. This means that when a form is destroyed, all the components on the form are destroyed also. Finally, when the memory for the application itself is freed, the memory for the form (and all its owned components) is also freed.

Don't confuse ownership of a component with being the parent of a component. A parent is a windowed  control that contains a child window. The parent and the owner of a windowed component can be different components.


Parent
Parent Property

Description

The Parent property contains the name of the parent of the control. The parent of a control is the windowed control that contains the control. If one control (parent) contains others, the contained controls are child controls of the parent. For example, if your application includes three radio buttons in a group box, the group box is the parent of the three radio buttons, and the radio buttons are the child controls of the group box.

Don't confuse the Parent property with the Owner property. A form is the owner of all the components on it, whether or not they are windowed controls. A child control is always a windowed control contained within another windowed control (its parent). If you put three radio buttons in a group box on a form, the owner of the radio buttons is still the form, while the parent is the group box.

If you are creating a new control, you must assign a Parent property value for the new control. Usually, this is a form, panel, group box, or some control that is designed to contain another. It is possible to assign any windowed control as the parent, but the contained control is likely to be painted over.

When the parent of a control is destroyed, all controls that are its children are also destroyed.


ParentColor
ParentColor Property

Description

The ParentColor property determines where a control looks for its color information. If ParentColor is True, the control uses the color in its parent component's Color property. If ParentColor is False, the control uses its own Color property. Except for the radio group, database radio group, label and database text controls, the default value is False.

By using ParentColor, you can ensure that all the controls on a form have a uniform appearance. For example, if you change the background color of your form to gray, by default, the controls on the form will also have a gray background.

To specify a different color for a particular control, specify the desired color as the value of that control's Color property, and ParentColor becomes False automatically.


ParentCtl3D
ParentCtl3D Property

Description

The ParentCtl3D property determines where a component looks to determine if it should appear three  dimensional. If ParentCtl3D is True, the component uses the dimensionality of its parent component's Ctl3D property. If ParentCtl3D is False, the control uses its own Ctl3D property. The default value is True.

By using ParentCtl3D, you can ensure that all the components on a form have a uniform appearance.  For example, if you want all components on a form to appear three dimensional, set the form's Ctl3D property to True and each component's ParentCtl3D property to True. Not only will all components have a three-dimensional appearance, but if you decide you prefer a two-dimensional appearance, you only have to change the Ctl3D property of the form and all the components will become two dimensional.

To specify a different dimensionality for a particular component, specify the dimensionality (True for 3D or False for 2D) as the value of that control's Ctl3D property, and ParentCtl3D becomes False automatically.


ParentFont
ParentFont Property

Description

The ParentFont property determines where a control looks for its font information. If ParentFont is True, the control uses the font in its parent component's Font property. If ParentFont is False, the control uses its own Font property.

By using ParentFont, you can ensure that all the controls on a form have a uniform appearance. For example, if you want all the controls in a form to use 12-point Courier for their font, you can set the form's Font property to that font. By default, all the controls on that form will use the same font.

To specify a different font for a particular control, specify the desired font as the value of the control's Font property, and ParentFont becomes False automatically.

When the ParentFont is True for a form, the form uses the value of the application's Font property


ParentShowHint
ParentShowHint Property

Description

The ParentShowHint property determines where a control looks to find out if Help Hint, specified as the value of the Hint property for the control, should be shown. If ParentShowHint is True, the control uses the ShowHint property value of its parent. If ParentShowHint is False, the control uses its own ShowHint property.

By using ParentShowHint, you can ensure that all the controls on a form either show their Help Hints or don't show them. By default, ParentShowHint is True.

If don't want all the controls to have Help Hints, set the ShowHint property for those controls you do want to have Help Hints to True, and ParentShowHint becomes False automatically.

You can enable or disable all Help Hints for the entire application using the ShowHint property of the  application.

This property is not useful for the Magic Panel control, it has been included for compatablility and consistency.


PopupMenu
PopupMenu Property

Description

The PopupMenu property identifies the name of the pop-up menu that appears when the user selects the  component and presses the right mouse button (if the pop-up menu's AutoPopup property is True), or when the Popup method of the pop-up menu executes.


ShowHint
ShowHint Property

Description

The ShowHint property determines if the control should display a Help Hint when the user's mouse pointer rests momentarily on the control. The Help Hint is the value of the Hint property, which is displayed in a box just beneath the control. If ShowHint property is True, the Help Hint will appear.

If ShowHint is False, the Help Hint may or may not appear. If ParentShowHint is False also, the Help Hint won't appear. If, however, ParentShowHint is True, whether or not the Help Hint appears depends on the setting of the ShowHint property of the control's parent. For example, imagine a check box within a group box. If the ShowHint property of the group box is True and the ParentShowHint property of the check box is True, but the ShowHint property of the check box is False, the check box will still display its Help Hint.  The default value is False.

Changing the ShowHint value to True automatically sets the ParentShowHint property to False.

This property is not useful for the Magic Panel control, it has been included for compatablility and consistency.


Showing
Showing Property

Description

Run-time and read only. The Showing property specifies whether a component is currently showing on the

screen. If the Visible properties of a component and all the parents in its parent hierarchy are True, Showing is True. If one of the ancestors of the component has a Visible property value of False, Showing is False.


TabOrder
TabOrder Property

Description

The TabOrder property indicates the position of the control in its parent's tab order, the order in which controls receive the focus when the user presses the Tab key.

Initially, the tab order is always the order in which the components were added to the form, but you can change this by changing the TabOrder property. The value of the TabOrder property is unique for each component on the form. The first component added to the form has a TabOrder value of  0, the second is 1, the third is 2, and so on. These values determine where a control is in the tab order.  Each component has a unique tab-order value within its parent. If you change the TabOrder property value of one component to be the same as the value of a second component, Delphi automatically renumbers the TabOrder value for all the other  components. For example, suppose a component is sixth in the tab order. If you change the component's TabOrder property value to 3 (making the component fourth in the tab order), the component that was originally fourth in the tab order now becomes fifth, and the component that was fifth becomes sixth.

If you attempt to give a component a TabOrder value greater than the number of components on the form minus one (because numbering starts with 0), Delphi won't accept the new value, but will enter the value that assures the component will be the last in the tab order.

The control with the TabOrder value of 0 is the control that will have the focus when the form first appears.

TabOrder is meaningful only if the TabStop property is True.


TabStop
TabStop Property

Description

The TabStop property determines if the user can tab to a control. If TabStop is True, the control is in the tab order. If TabStop is False, the control is not in the tab order; therefore, the user can't press the Tab key to move to the control. The default value is True.


Tag
Tag Property

Description

The Tag property is available to store an integer value as part of a component. While the Tag property has no meaning to Delphi, your application can use the property to store a value for its special needs.


Top
Top Property

Description

The Top property determines the y coordinate of the top left corner of a control, relative to the form in pixels. For forms, the value of the Top property is relative to the screen in pixels.


Visible
Visible Property

Description

The Visible property determines whether the component appears onscreen. If Visible is True, the component appears. If Visible is False, the component is not visible.

For controls, calling the Show method makes the control's Visible property True, but it also performs other actions to ensure that the user can see the control.

For field components, the Visible property determines if a field can be displayed in a TDBGrid component.

If Visible is False, the field is not displayed.  The default value is True for all components except for forms.


Width
Width Property

The Width property determines the horizontal size of the control or form in pixels. When you increase the

Width property value, the form or control becomes wider. If you decrease the value, the form or control

becomes narrower.


HintAsLabel
HintAsLabel Property

Description

The HintAsLabel property will turn on the label property attributes of Magic Panel.  By default this property is False. If the property is False the Magic Panel will perform exactly like a standard Tpanel Control.


HintInterSpace
HintInterSpace Property

Description

The HintInterSpace property will add additional spacing between the label and the child control containing the label.

This property acts differently based on the HintLabelPosition property.  If the HintLabelPosition is Above or Below, the HintInterSpace value will move the label up or down by pixels.  Likewise if the HintLabelPosition is Left or Right, the label will move to the left or right.  A value of  0 will place the label as close to the child control as possible.


HintLabelFont3D
HintLabelFont3D Property

Description

The HintLabelFont3D property will create one of five different Font 3D effects.  The Normal value will set the font to its standard look.

Values

tfInsetLight

tfInsetHeavy

tfRaisedLight

tfRaisedHeavy

tfFloat3D

NOTE: When displaying fonts in 3D the font color properties may not take effect.  Try setting the font color when the font is in normal mode, then set the 3D effect.


HintLabelHPosition
HintLabelHPosition Property

Description

The HintLabelHPosition property will position the label on a horizontal axis. Default value is thRight.

Values

thLeft

thCenter

thRight


HintLabelVPosition

Description

The HintLabelVPosition property will position the label on a vertical axis.  Default value is tvCenter.

Values

tvTop

tvCenter

tvBottom


HintLabelPosition
HintLabelPosition Property

Description

HintLabelPosition property will position the label around the child control.  The default value is tpLeft.

Value

tpAbove

tpBelow

tpLeft

tpRight


HintLabelWidth
HintLabelWidth Property

Description

HintLabelWidth property is an integer value.  By setting this property, the Magic Panel Control can setup clipping areas for the label text.

When HintLabelPosition is set to tpLeft or tpRight, the HintLabelWidth property will change the width of the childs label.  The Height of the label will be equal to the height of the child control.  If you change the label fonts size larger than the child controls font size, the top and or bottom may be clipped.

When the HintLabelPosition is set to tpAbove or tpBelow, the HintLabelWidth property will change the height of the child label.  The width of the label will be equal to the width of the child control.  If you change the label fonts size larger than the child controls font size, the left or right may be clipped.


BeginDrag
BeginDrag Method

Description

The BeginDrag method starts the dragging of a control. If the Immediate parameter is True, the mouse

pointer changes to the value of the DragCursor property and dragging begins immediately. If Immediate is  False, the mouse pointer doesn't change to the value of the DragCursor property and dragging doesn't begin until the user moves the mouse pointer a short distance (5 pixels). This allows the control to accept mouse clicks without beginning a drag operation.

Your application needs to call the BeginDrag method to begin dragging only when the DragMode property value for the control is dmManual.


BringToFront
BringToFront Method

Description

The BringToFront method puts the component or form in front of all other components or forms within

its parent component or form. BringToFront is especially useful for making certain that a form is visible.

You can also use it to reorder overlapping components within a form.

The order in which controls stack on top of each order (also called the Z order) depends on whether the

controls are windowed or non-windowed controls. For example, if you put a label and an image on a

form so that one is on top of the other, the one you placed first on the form is the one on the bottom.

Because both the label and the image are non-windowed controls, they "stack" as you would expect

them to. Suppose that the label is on the bottom. If you call the BringToFront method for the label, the

label then appears on top of the image.

The stacking order of windowed controls is the same. For example, if you put a memo on a form, then

put a check box on top of it, the check box remains on top. If you call BringToFront for the memo, the

memo appears on top.

The stacking order of windowed and non-windowed controls cannot be mingled. For example, if you put

a memo, a windowed control, on a form, and then put a label, a non-windowed control, on top of it, the

label disappears behind the memo. Windowed controls always stack on top of non-windowed controls.

In this example, if you call the BringToFront method of the label, it remains behind the memo.


CanFocus
CanFocus Method

Description

The CanFocus method determines whether a control can receive focus. CanFocus returns True if both the

control and its parent(s) have their Visible and Enabled properties set to True. If all the Visible and Enabled properties of the control and the components from which the control descends are not True, then CanFocus returns False.


ClientToScreen
ClientToScreen Method

Description

The ClientToScreen method translates the given point from client area coordinates to global screen

coordinates. In client area coordinates (0, 0) corresponds to the upper left corner of the control's client

area. In screen coordinates (0, 0) corresponds to the upper left corner of the screen.

Using the ClientToScreen and ScreenToClient methods you can convert from one control's coordinate

system to another control's coordinate system.

For example:

P := TargetControl.ScreenToClient(SourceControl.ClientToScreen(P));

which converts P from coordinates in SourceControl to coordinates in TargetControl.


ContainsControl
ContainsControl Method

Description

The ContainsControl method indicates whether a specified control exists within a control. If the method returns True, the control specified as the value of the Control parameter exists within the control. If the method returns False, the specified control is not within the control.


Dragging
Dragging Method

Description

The Dragging method specifies whether a control is being dragged. If Dragging returns True, the control is being dragged. If Dragging is False, the control is not being dragged.


EndDrag
EndDrag Method

Description

The EndDrag method stops an object from being dragged any further. If the Drop parameter is True, the object being dragged is dropped. If the Drop parameter is False, the object is not dropped and dragging is canceled.


FindComponent
FindComponent Method

Description

The FindComponent method returns the component in the Components array property with the name that  matches the string in the AName parameter. FindComponent is not case sensitive.


Focused
Focused Method

Description

The Focused method is used to determine whether a windowed control has the focus and is therefore is the ActiveControl.


GetTextBuf
GetTextBuf Method

Description

The GetTextBuf method retrieves the control's text and copies it into the buffer pointed to by Buffer, up to the number of characters given by BufSize, and returns the number of characters copied.  The resulting text in Buffer is a null-terminated string.  To find out how many characters the buffer needs to hold the entire text, you can call the GetTextLen method before calling GetTextBuf.

Usually you only need to use GetTextBuf and the corresponding SetTextBuf when working with strings longer than 255 characters. Because Object Pascal strings have a limit of 255 characters, such properties as Text for an edit box, Items for a list box, and Lines for a memo control only allow you to work with strings up to 255 characters. GetTextBuf and SetTextBuf use null-terminated strings that can be up to 64K in length.


GetTextLen
GetTextLen Method

Description

The GetTextLen method returns the length of the control's text. The most common use of GetTextLen is to find the size needed for a text buffer in the GetTextBuf method.


Hide
Hide Method

Description

The Hide method makes a form or control invisible by setting the Visible property of the form or control to False. Although a form or control that is hidden is not visible, you can still set the properties of the form or control, or call its methods.


InsertComponent
InsertComponent Method

Description

The InsertComponent method makes the component own the component passed in the AComponent  parameter. The component is added to the end of the Components array property. The inserted component must have no name (no specified Name property value), or the name must be unique among all others in the Components list.

When the owning component is destroyed, AComponent is destroyed also.


InsertControl
InsertControl Method

Description

The InsertControl method inserts a control within the Controls property of a windowed control, making the inserted control a child, and the containing control the parent. The inserted control is the value of the AControl parameter.


Invalidate
Invalidate Method

Description

The Invalidate method forces a control to repaint as soon as possible.


Refresh
Refresh Method

Description

The Refresh method erases whatever image is on the screen and then repaints the entire control. Within the implementation of Refresh, the Invalidate and then the Update methods are called.


RemoveComponent
RemoveComponent Method

Description

The RemoveComponent method removes the component specified in the AComponent parameter from the

component's Components list. That position in the list becomes nil.


Repaint
Repaint Method

Description

The Repaint method forces the control to repaint its image on the screen, but without erasing what already appears there. To erase before repainting, call the Refresh method instead of Repaint.


ScaleBy
ScaleBy Method

Description

The ScaleBy method scales a control to a percentage of its former size. The M parameter is the multiplier and the D parameter is the divisor. For example, if you want a control to be 75% of its original size, specify the value of M as 75, and the value of D as 100 (75/100). You could also obtain the same results by specifying the value of M as 3, and the value of D as 4 (3/4). Both fractions are equal and result in the control being scaled by the same amount, 75%.

If you want the control to be 33% larger than its previous size, specify the value of M as 133, and the value of D as 100 (133/100). You can also obtain the same results by specifying the value of M as 4, and the value of D as 3 (4/3), as the fraction 133/100 is approximately equal to 4/3.


ScreenToClient
ScreenToClient Method

Description

The ScreenToClient method is used to determine the control coordinates in pixels of a point on the screen. ScreenToClient returns X and Y coordinates in a record of type TPoint.


ScrollBy
ScrollBy Method

Description

The ScrollBy method scrolls the contents of a form or windowed control. You will seldom need to call the  ScrollBy method unless you want to write your own scrolling logic rather than use a scroll bar.

The DeltaX parameter is the change in pixels along the X axis. A positive DeltaX value scrolls the contents to the right; a negative value scrolls the contents to the left. The DeltaY parameter is the change in pixels along the Y axis. A positive DeltaY value scrolls the contents down; a negative value scrolls the contents up.


SendToBack
SendToBack Method

Description

The SendToBack method puts a windowed component behind all other windowed components within its parent component or form, or it puts a non-windowed component behind all other non-windowed components within its parent component or form. If the component has the input focus when the SendToBack method executes, it loses the input focus.

SendToBack is useful for changing the order of overlapping controls or forms.  The order in which controls stack on top of each order (also called the Z order) depends on whether the controls are windowed or non-windowed. For example, if you put a label and an image on a form so that one is on top of the other, the first one you placed on the form is the one on the bottom. Because both the label and the image are non-windowed controls, they "stack" as you would expect them to.

Suppose that the image is on the top. If you call the SendToBack method for the image, the label then appears on top of the image.

The stacking order of windowed controls is the same. For example, if you put a memo on a form, then put a check box on top of it, the memo remains on the bottom. If you call SendToBack for the check box, the memo appears on top.

The stacking order of windowed and non-windowed controls cannot be mingled. For example, if you put a memo, a windowed control, on a form, and then put a label, a non-windowed control, on top of it, the label disappears behind the memo. Windowed controls always "stack" on top of non-windowed controls. In this example, if you call the SendToBack method of the memo, it remains on top of the label.


SetBounds
SetBounds Method

Description

The SetBounds method sets the component's boundary properties, Left, Top, Width, and Height, to the values passed in ALeft, ATop, AWidth, and AHeight, respectively.

SetBounds enables you to set more than one of the component's boundary properties at a time. Although you can always set the individual boundaries, using SetBounds enables you to make several changes at once without repainting the control for each change.


SetFocus
SetFocus Method

Description

The SetFocus method gives the input focus to the control. If the control is a form, the form calls the SetFocus method of its active control.


SetTextBuf
SetTextBuf Method

Description

The SetTextBuf method sets the control's text to the text in the buffer pointed to by Buffer. Buffer must point to a null-terminated string.

Usually, you use SetTextBuf and the corresponding GetTextBuf only when you need to work with strings that are longer than 255 characters. Because an Object Pascal style string has a limit of 255 characters, such properties as Text for an edit box, Items for a list box, and Lines for a memo control do not allow you to work with strings longer than 255 characters. GetTextBuf and SetTextBuf use null-terminated strings that are up to 64K in length.


Show
Show Method

Description

The Show method makes a form or control visible by setting its Visible property to True. If the Show method of a form is called and the form is somehow obscured, Show tries to make the form visible by bringing it to the front with the BringToFront method.


Update
Update Method

Description

The Update method calls the Windows API UpdateWindow function, which processes any pending paint  messages.


OnClick
OnClick Event

Description

The OnClick event occurs when the user clicks on the component. Typically, this is when the user presses and releases the primary mouse button with the mouse pointer over the component.


OnDblClick
OnDblClick Event

Description

The OnDblClick event occurs when the user double-clicks the mouse button while the mouse pointer is over the component.


OnDragDrop
OnDragDrop Event

Description

The OnDragDrop event occurs when the user drops an object being dragged. Use the OnDragDrop event

handler to specify what you want to happen when the user drops an object. The Source parameter of the

OnDragDrop event is the object being dropped, and the Sender is the control the object is being dropped on. The X and Y parameters are the coordinates of the mouse positioned over the control.


OnDragOver
OnDragOver Event

Description

The OnDragOver event occurs when the user drags an object over a component. Usually you'll use an  OnDragOver event to accept an object so the user can drop it.

The OnDragOver event accepts an object when its Accept parameter is True.

Usually, you will want the cursor to change shape, indicating that the control can accept the dragged object if the user drops it. You can change the shape of the cursor by changing the value of the DragCursor property for the control at either design or run time before an OnDragOver event occurs.


OnEndDrag
OnEndDrag Event

Description

The OnEndDrag event occurs whenever the dragging of an object ends, either by dropping the object or by

canceling the dragging. Use the OnEndDrag event handler to specify any special processing you want to  occur when dragging stops. If the dragged object was dropped and accepted by the control, the Target  parameter of the OnEndDrag event is True. If the object was not dropped successfully, the value of Target is nil.


OnMouseDown
OnMouseDown Event

Description

The OnMouseDown event occurs when the user presses a mouse button with the mouse pointer over a  control. Use the OnMouseDown event handler when you want some processing to occur as a result of  pressing a mouse button.

The Button parameter of the OnMouseDown event identifies which mouse button was pressed. By using the Shift parameter of the OnMouseDown event handler, you can respond to the state of the mouse buttons and shift keys. Shift keys are the Shift, Ctrl, and Alt keys.


OnMouseMove
OnMouseMove Event

Description

The OnMouseMove occurs when the user moves the mouse pointer when the mouse pointer is over a control. Use the OnMouseMove event handler when you want something to happen when the mouse pointer moves within the control.

By using the Shift parameter of the OnMouseDown event handler, you can respond to the state of the mouse buttons and shift keys. Shift keys are the Shift, Ctrl, and Alt keys.


OnMouseUp
OnMouseUp Event

Description

The OnMouseUp event occurs when the user releases a mouse button that was pressed with the mouse  pointer over a component. Use the OnMouseUp event handler when you want processing to occur when the user releases a mouse button.

The OnMouseUp event handler can respond to left, right, or center mouse button presses and shift key plus mouse button combinations. Shift keys are the Shift, Ctrl, and Alt keys.


OnResize
OnResize Event

Description

The OnResize event occurs whenever the form is resized while an application is running. Use the OnResize event handler when you want something to happen in your application when the form is resized.


Copyright
Copyright/License Notice

License Agreement:

Synchro-Graphix Software provides this program and grants you a non-exclusive license for its use.  You assume responsibility for selection of this  program for your purposes, and for the installation, use, and results from the use of program.

This agreement becomes effective when you show your acceptance of these terms by using this package.

This software is licensed to you as follows:

a) Only one user is authorized to use this program on one computer.  It may not be used in a multi-user configuration.  Contact Synchro-Graphix Software to arrange for additional licensing options.

(b) You may make backup copies for your own use only.

(c) You may distribute the control only when compiled into your own program.

If you fail to complyt to the conditions of this agreement, your license is automatically terminated.

This license is effective May 5, 1995 until terminated.

This license is governed by the laws of the State of New Jersey.

Borland Delphi is copyrighted by Borland International

MicroSoft Windows is copyrighted by Microsoft Corp.

MagicPanel is ©Copyright 1995 Synchro-Graphix Software All Rights Reserved


Register
Registration

To register Magic Panel

Send $29.95 + S&H check or money order (US Funds) to

Harvey L. Orloff

18 Finderne Avenue

Bridgewater, New Jersey  08807-3355

Please make check payable to Harvey L. Orloff

Shipping and Handling (S&H)

In the US add 4.50

Outside the US add 7.50

Printable Registration Form


RegForm
Magic Panel Registration

Company Name_____________________________________________

Name     	______________________________________________

Address	______________________________________________

______________________________________________

City          	______________________________________________

State	_______________    ZIP _________  Country__________

Phone	_________________________________

Product	Magic Panel

Number to order___________

Send To:

Harvey Orloff	x 29.95  ___________

18 Finderne Avenue

Bridgewater, New Jersey, 08807-3355	In US add	             +  4.50

Outside US add             +  7.50

Total	___________


Example
Example Using Magic Panel

Click on the Magic Panel in the control tool bar then click and drag out a Magic Panel on your form.

Next Place you other controls (Edit Box etc...) into the Magic Panel.

Now you can set the Hint property of the Edit1 and Edit2.

Now we are going to setup the Hint attribute properties of Magic Panel.  The most important property is the HintLabelWidth this allows for label clipping or turning labels off.  By default this property is 0 so your labels won't show.  Set HintLabelWidth to a value 85, or 100 is usually good, and your labels will become visible.

Here is the our finished example.


Whats New
What's New in Version 1.2

In this version I have added the delphi standard Hint properties back to each control.  In versions 1.0 and 1.1 I over looked the fact that delphi can use a pipe |.  Basically the left side of the pipe is the standard button popup hint, the right side of the pipe can be used in a status bar at the bottom (or anywhere you would like it) to display a status.  Magic panel will parse and use the left side of the pipe allowing you to have a status.